package runnable;

/*runnable方法
 * 1.创建线程类
 * 2.重写run方法
 * 3.创建thread实例(有参数，以自定义的runnbale线程类作为实例传入)
 * */
public class Myrunnable implements Runnable {
    @Override
    public void run() {
       /* while(true){
            System.out.println("sss");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }*/
        int i = 1;
        while (i <= 100) {
            System.out.println(Thread.currentThread().getName() + i++);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
